//单号查询，等于是直接输id跳转至详情页
import React, {Component} from 'react'
import {View, Text, Image, TouchableOpacity, TextInput} from 'react-native'
import {screenWidth} from '../../configs/styles'

class searchApply extends Component{
  static navigationOptions = ({navigation}) => {
    return {
      title: '单号查询'
    }
  };

  constructor(props){
    super(props)
    this.state = {
      no: ''
    }
  }

  goApply = ()=>{
    this.props.navigation.navigate('apply_show', {apply_id: this.state.no})
  }

  render(){
    return (
      <View
        style={{flex: 1, alignItems: 'center', backgroundColor: 'white', justifyContent: 'center', paddingBottom: 80}}>
        <View>
          <Image source={require('../../assets/images/avatar.jpeg')} style={{width: 60, height: 60}}/>
        </View>
        <View style={{padding: 20}}>
          <TextInput value={this.state.no} onChangeText={(v)=>this.setState({no: v})}
                     placeholder={'请输入申请单号查询'}
                     style={{textAlign:'center', padding: 10, borderRadius:6, backgroundColor: 'lightgrey', width: screenWidth - 60}}/>
        </View>
        <TouchableOpacity onPress={this.goApply}
          style={{backgroundColor: '#3980f4',paddingLeft: 30, borderRadius:6, paddingRight: 30, paddingTop: 10, paddingBottom: 10}}>
          <Text style={{color: 'white'}}>查询</Text>
        </TouchableOpacity>
      </View>
    )
  }
}
export default searchApply